package com.ruoyi.ring.mapper;

import com.ruoyi.ring.domain.RingSleepDetail;
import com.ruoyi.ring.domain.dto.RingSleepDetailInfoDTO;
import com.ruoyi.ring.domain.dto.RingSleepDetailListDTO;
import com.ruoyi.ring.domain.vo.RingSleepDetailVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 睡眠详情Mapper接口
 * 
 * @author liuwp
 * @date 2025-08-18
 */
public interface RingSleepDetailMapper 
{
    /**
     * 查询睡眠详情
     * 
     * @param id 睡眠详情主键
     * @return 睡眠详情
     */
    public RingSleepDetail selectRingSleepDetailById(Long id);

    /**
     * 查询睡眠详情列表
     * 
     * @param ringSleepDetail 睡眠详情
     * @return 睡眠详情集合
     */
    public List<RingSleepDetail> selectRingSleepDetailList(RingSleepDetail ringSleepDetail);

    /**
     * 可以业务主键查询一条睡眠详情
     *
     * @param ringSleepDetail 睡眠详情
     * @return 睡眠详情集合
     */
    public RingSleepDetail selectOneRingSleepDetail(RingSleepDetail ringSleepDetail);

    /**
     * 新增睡眠详情
     * 
     * @param ringSleepDetail 睡眠详情
     * @return 结果
     */
    public int insertRingSleepDetail(RingSleepDetail ringSleepDetail);

    /**
     * 修改睡眠详情
     * 
     * @param ringSleepDetail 睡眠详情
     * @return 结果
     */
    public int updateRingSleepDetail(RingSleepDetail ringSleepDetail);

    /**
     * 条件修改睡眠详情
     *
     * @param ringSleepDetail 睡眠详情
     * @param ringSleepDetail 睡眠详情条件
     * @return 结果
     */
    public int updateRingSleepDetailCondition(@Param("ringSleepDetail") RingSleepDetail ringSleepDetail, @Param("ringSleepDetailCondition") RingSleepDetail ringSleepDetailCondition);

    /**
     * 删除睡眠详情
     * 
     * @param id 睡眠详情主键
     * @return 结果
     */
    public int deleteRingSleepDetailById(Long id);

    /**
     * 条件删除睡眠详情
     *
     * @param ringSleepDetail 睡眠详情
     * @return 结果
     */
    public int deleteRingSleepDetailByCondition(RingSleepDetail ringSleepDetail);

    /**
     * 批量删除睡眠详情
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteRingSleepDetailByIds(Long[] ids);

    /**
     * 新增睡眠详情返回生成id
     *
     * @param ringSleepDetail 睡眠详情
     * @return 结果
     */
    public int addRingSleepDetail(RingSleepDetail ringSleepDetail);

    /**
     * 查询睡眠详情列表
     *
     * @param sleepDetailListDTO 睡眠详情
     * @return 睡眠详情集合
     */
    public List<RingSleepDetail> queryList(RingSleepDetailListDTO sleepDetailListDTO);

    /**
     * 可以业务主键查询一条睡眠详情
     *
     * @param sleepDetailInfoDTO 睡眠详情
     * @return 睡眠详情集合
     */
    List<RingSleepDetail> querySleepInfo(RingSleepDetailInfoDTO sleepDetailInfoDTO);

    List<RingSleepDetail> queryQualityScore(RingSleepDetailInfoDTO sleepDetailInfoDTO);


    RingSleepDetailVO queryLongSleepInfo(RingSleepDetailInfoDTO sleepDetailInfoDTO);

    /**
     * 睡眠规律性
     * @param sleepDetailInfoDTO
     * @return
     */
    List<RingSleepDetail> querySleepRegularityList(RingSleepDetailInfoDTO sleepDetailInfoDTO);
    /**
     * 睡眠时长（能算比例、能获取清醒次数，能算清醒时长，能算入睡时间）
     * @param sleepDetailInfoDTO
     * @return
     */
    List<RingSleepDetail> querySleepDuration(RingSleepDetailInfoDTO sleepDetailInfoDTO);

    List<RingSleepDetailVO> queryShortSleepInfo(RingSleepDetailInfoDTO sleepDetailInfoDTO);

    List<RingSleepDetail> queryWeekOrMonthLongInfo(RingSleepDetailInfoDTO sleepDetailInfoDTO);

    List<RingSleepDetail> queryWeekOrMonthShortInfo(RingSleepDetailInfoDTO sleepDetailInfoDTO);

    List<RingSleepDetail> querySleepTrend(RingSleepDetailInfoDTO sleepDetailInfoDTO);

    /** 去当天提一条长睡眠信息 */
    RingSleepDetail querySleepInfoDetail(RingSleepDetailInfoDTO ringSleepDetailInfoDTO);
}
